package com.kczd.jinlan.fragment.orderfragment;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ListView;

import com.kczd.jinlan.R;
import com.kczd.jinlan.adapter.normaladapter.QuanBuAdapter;
import com.kczd.jinlan.model.Whole;

import java.util.ArrayList;
import java.util.List;

/**
 * zhangy
 * Created by Administrator on 2017/5/17.
 */

public class QuanbuFragment extends Fragment {

    private View view;
    private ListView listview_quanbu;
    private List<Whole> datas;

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        view = inflater.inflate(R.layout.quanbu_fragment, null);
        data();
        init();
        return view;
    }

    private void init() {
        listview_quanbu = (ListView) view.findViewById(R.id.listview_quanbu);
        listview_quanbu.setAdapter(new QuanBuAdapter(datas));
    }

    private void data() {
        datas = new ArrayList<>();
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 黄瓜", "5斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "6斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 茄子", "7斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 青菜", "8斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 豆角", "9斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "1斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "2斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "3斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "4斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "5斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
        datas.add(new Whole(R.mipmap.shuiguo, "新鲜蔬菜 西兰花", "10斤装x2", "￥14.00", "2017-04-21", "2", "￥28.00"));
    }
}
